package com.java.control.search;

/**
 * 角色搜索
 * @author wqf
 * @version  Nov 24, 2011 11:55:45 AM
 */
public class RoleSearchCond extends SearchCond{
	
	private String roleName;
	
	public String getRoleName() {
		return roleName;
	}

	public void setRoleName(String roleName) {
		this.roleName = roleName;
	}
	
	public ConditionPart getCondition(){
		ConditionPart cp=new ConditionPart();
		StringBuffer searchStr=new StringBuffer(" 1=1");
		
		if(null!=roleName){
			searchStr.append(" and roleName like ?");
			cp.getParams().add("%"+roleName+"%");
		}
		cp.setExpression(searchStr.toString());
		return cp;
	}

}
